import request from "@/utils/request";

const api_name = "/admin/hosp/hospitalSet";

export const getPageList = (
	page: number,
	limit: number,
	searchObj?: any
): any => {
	return request({
		url: `${api_name}/${page}/${limit}`,
		method: "get",
		params: searchObj,
	});
};

export const getById = (id: number) => {
	return request({
		url: `${api_name}/get/${id}`,
		method: "get",
	});
};

export const save = (hospitalSet: any) => {
	return request({
		url: `${api_name}/save`,
		method: "post",
		data: hospitalSet,
	});
};

export const updateById = (hospitalSet: any) => {
	return request({
		url: `${api_name}/update`,
		method: "put",
		data: hospitalSet,
	});
};

export const removeById = (id: number) => {
	return request({
		url: `${api_name}/remove/${id}`,
		method: "delete",
	});
};

export const removeRows = (idList: number[]) => {
	return request({
		url: `${api_name}/batchRemove`,
		method: "delete",
		data: idList,
	});
};

export const lock = (id: number, status: number) => {
	return request({
		url: `${api_name}/lock/${id}/${status}`,
		method: "get",
	});
};

export const sendSignKey = (id: number) => {
	return request({
		url: `${api_name}/sendSignKey/${id}`,
		method: "get",
	});
};
